<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/usercenter/include/base_usercenter_pre_part.jsp"></jsp:include>
<script language="javascript" src="<%=request.getContextPath()%>/region/js/region.js"></script>
<div class="box_blue">
	<div class="box_title">
		新增地址薄信息
		<input type="button" onclick="javascript:jtool.goto('<%=request.getContextPath()%>/usercenter/address/listAddress.do');" value="返回地址列表" />
	</div>
	<form action="<%=request.getContextPath()%>/usercenter/address/saveAddress.do" method="post">
		<table width="100%">
			<s:hidden name="address.id" />
			<s:hidden name="address.user.id" />
			<tr>
				<td class="tdLabel">
					地址
				</td>
				<td>
					<s:if test="address!=null && address.region!=null">
						<s:property value="address.region.fullName" />
						<input type="button" value="更改" onclick="javascript:$('#region').show();" />
					</s:if>
					<div id="region" <s:if test="address!=null && address.region!=null">class="hidden"</s:if>>
						<input type="hidden" name="address.region.id" id="regionId" value="<s:property value="address.region.id"/>" />
						<font>省:<select name="province" onchange="javascript:getRegion('region', 'city',$(this).val())"></select> </font>
						<font class="hidden">市:<select name="city" onchange="javascript:getRegion('region', 'district',$(this).val());"></select> </font>
						<font class="hidden"> 区:<select name="district" onchange="javascript:$('#regionId').val($(this).val());"></select> </font>
					</div>
					<s:if test="address!=null && address.region!=null">
						<script>initRegion("region", "<s:property value="address.region.id"/>","province","city","district");</script>
					</s:if>
					<s:else>
						<script>getRegion("region", "province");</script>
					</s:else>
				</td>
			</tr>
			<s:textfield name="address.address" label="%{getText('address')}" cssClass="longinput"/>
			<s:textfield name="address.postcode" label="%{getText('postcode')}" />
			<s:textfield name="address.email" label="%{getText('email')}" />
			<s:textfield name="address.phone" label="%{getText('phone')}" />
			<s:textfield name="address.tel" label="%{getText('tel')}" />
			<s:textarea name="address.note" cols="40" label="%{getText('note')}" />
			<tr>
				<td></td>
				<td>
					<input type="submit" value="提交" />
				</td>
			</tr>
		</table>
	</form>
</div>
<jsp:include page="/usercenter/include/base_usercenter_last_part.jsp"></jsp:include>